agora inbox for [email protected]help / color / mirror / Atom feed
Possible NULL dereferencing (src/backend/tcop/pquery.c) 969+ messages / 3 participants [nested] [flat]
* Possible NULL dereferencing (src/backend/tcop/pquery.c) @ 2020-06-26 14:31 Ranier Vilela <[email protected]> 2020-06-26 21:24 ` Re: Possible NULL dereferencing (src/backend/tcop/pquery.c) Tom Lane <[email protected]> 0 siblings, 1 reply; 969+ messages in thread From: Ranier Vilela @ 2020-06-26 14:31 UTC (permalink / raw) To: PostgreSQL Hackers <[email protected]> Hi, Per Coverity. Perhaps it is excessive caution. Probably assertion check has already caught all possible errors. But, redundancy may not cost as much and is worth it. 1.Assertion check /* Caller messed up if we have neither a ready query nor held data. */ Assert(queryDesc || portal->holdStore); But in release, if QueryDesc is NULL and portal->holdStore is NULL too, when Call PushActiveSnapshot *deference* NULL check can happen. 2. if (portal->atEnd || count <= 0) is True No need to recheck count against FETCH_ALL. Is it worth correcting them? regards, Ranier Vilela Attachments: [application/octet-stream] fix_null_deference_pquery.patch (1.5K, ../../CAEudQAppKDbMi=mijz9ayFpj4x0VQg9ZcHVK2F90VKM7ozqyfA@mail.gmail.com/3-fix_null_deference_pquery.patch) download | inline diff: diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index 96ea74f118..6329756f3a 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -878,6 +878,11 @@ PortalRunSelect(Portal portal, */ if (queryDesc) queryDesc->dest = dest; + else if (!portal->holdStore) + ereport(ERROR, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cursor can not scan"), + errhint("Not ready held data, to scan."))); /* * Determine which direction to go in, and check to see if we're already @@ -898,11 +903,12 @@ PortalRunSelect(Portal portal, count = 0; /* don't pass negative count to executor */ } else + { direction = ForwardScanDirection; - - /* In the executor, zero count processes all rows */ - if (count == FETCH_ALL) - count = 0; + /* In the executor, zero count processes all rows */ + if (count == FETCH_ALL) + count = 0; + } if (portal->holdStore) nprocessed = RunFromStore(portal, direction, (uint64) count, dest); @@ -938,11 +944,12 @@ PortalRunSelect(Portal portal, count = 0; /* don't pass negative count to executor */ } else + { direction = BackwardScanDirection; - - /* In the executor, zero count processes all rows */ - if (count == FETCH_ALL) - count = 0; + /* In the executor, zero count processes all rows */ + if (count == FETCH_ALL) + count = 0; + } if (portal->holdStore) nprocessed = RunFromStore(portal, direction, (uint64) count, dest); ^ permalink raw reply [nested|flat] 969+ messages in thread
* Re: Possible NULL dereferencing (src/backend/tcop/pquery.c) 2020-06-26 14:31 Possible NULL dereferencing (src/backend/tcop/pquery.c) Ranier Vilela <[email protected]> @ 2020-06-26 21:24 ` Tom Lane <[email protected]> 2020-06-26 23:07 ` Re: Possible NULL dereferencing (src/backend/tcop/pquery.c) Ranier Vilela <[email protected]> 0 siblings, 1 reply; 969+ messages in thread From: Tom Lane @ 2020-06-26 21:24 UTC (permalink / raw) To: Ranier Vilela <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> Ranier Vilela <[email protected]> writes: > 1.Assertion check > /* Caller messed up if we have neither a ready query nor held data. */ > Assert(queryDesc || portal->holdStore); > But in release, if QueryDesc is NULL and portal->holdStore is NULL too, > when Call PushActiveSnapshot *deference* NULL check can happen. > 2. if (portal->atEnd || count <= 0) is True > No need to recheck count against FETCH_ALL. > Is it worth correcting them? No. The assertion already says that that's a case that cannot happen. Or to look at it another way: if the case were to occur in a devel build, you'd get a core dump at the assertion. If the case were to occur in a production build, you'd get a core dump at the dereference. Not much difference. Either way, it's a *caller* bug, because the caller is supposed to make sure this cannot happen. If we thought that it could possibly happen, we would use an ereport but not an assertion; having both for the same condition is quite misguided. (If Coverity is whining about this for you, there's something wrong with your Coverity settings. In the project's instance, Coverity accepts assertions as assertions.) I'm unimpressed with the other proposed change too; it's making the logic more complicated and fragile for a completely negligible "performance gain". Moreover the compiler could probably make the same optimization. regards, tom lane ^ permalink raw reply [nested|flat] 969+ messages in thread
* Re: Possible NULL dereferencing (src/backend/tcop/pquery.c) 2020-06-26 14:31 Possible NULL dereferencing (src/backend/tcop/pquery.c) Ranier Vilela <[email protected]> 2020-06-26 21:24 ` Re: Possible NULL dereferencing (src/backend/tcop/pquery.c) Tom Lane <[email protected]> @ 2020-06-26 23:07 ` Ranier Vilela <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Ranier Vilela @ 2020-06-26 23:07 UTC (permalink / raw) To: Tom Lane <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> Em sex., 26 de jun. de 2020 às 18:24, Tom Lane <[email protected]> escreveu: > Ranier Vilela <[email protected]> writes: > > 1.Assertion check > > /* Caller messed up if we have neither a ready query nor held data. */ > > Assert(queryDesc || portal->holdStore); > > > But in release, if QueryDesc is NULL and portal->holdStore is NULL too, > > when Call PushActiveSnapshot *deference* NULL check can happen. > > > 2. if (portal->atEnd || count <= 0) is True > > No need to recheck count against FETCH_ALL. > > > Is it worth correcting them? > > No. > > The assertion already says that that's a case that cannot happen. > Or to look at it another way: if the case were to occur in a devel > build, you'd get a core dump at the assertion. If the case were > to occur in a production build, you'd get a core dump at the > dereference. Not much difference. Either way, it's a *caller* > bug, because the caller is supposed to make sure this cannot happen. > If we thought that it could possibly happen, we would use an ereport > but not an assertion; having both for the same condition is quite > misguided. > Ok, thats a job of Assertion. But I still worry that, in some rare cases, portal-> holdStore might be corrupted in some way and the function is called, causing a segmentation fault. > > (If Coverity is whining about this for you, there's something wrong > with your Coverity settings. In the project's instance, Coverity > accepts assertions as assertions.) > Probable, because reports this: CID 10127 (#2 of 2): Dereference after null check (FORWARD_NULL)8. var_deref_op: Dereferencing null pointer queryDesc. > > I'm unimpressed with the other proposed change too; it's making the logic > more complicated and fragile for a completely negligible "performance > gain". Moreover the compiler could probably make the same optimization. > Ok. Anyway, thank you for by responding, your observations are always valuable and help learn "the postgres way" to develop. It's not easy. best regards, Ranier Vilela ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 969+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 969+ messages in thread
end of thread, other threads:[~2026-03-12 15:09 UTC | newest] Thread overview: 969+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-06-26 14:31 Possible NULL dereferencing (src/backend/tcop/pquery.c) Ranier Vilela <[email protected]> 2020-06-26 21:24 ` Tom Lane <[email protected]> 2020-06-26 23:07 ` Ranier Vilela <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess 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